package cn.itcast.user.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {
    /**
     * 注册拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new HmallFilter())
                //添加拦截路径 拦截所有
                .addPathPatterns("/**");
                //排除被拦截的资源
          //      .excludePathPatterns(Arrays.asList("/**/*.css","/**/*.jpg","/**/*.js"));
    }
}
